///////////////////
/// mkII - Core ///
///////////////////

#pragma once

// Core includes
#include "../../Core/mkCoreIndependent.h"

// SSE includes
#include <xmmintrin.h>
#include <emmintrin.h>

namespace mk
{
namespace Core
{
namespace Math
{

typedef ::__m128  Vector128r;
typedef ::__m128i Vector128i;

// Allow the Vector and Matrix types to passed into SSE registers
namespace Vector1_MSTrick       { class __declspec(intrin_type) __declspec(align(16)) __m128; }
namespace Vector3_MSTrick       { class __declspec(intrin_type) __declspec(align(16)) __m128; }
namespace Vector4_MSTrick       { class __declspec(intrin_type) __declspec(align(16)) __m128; }
namespace Quaternion_MSTrick    { class __declspec(intrin_type) __declspec(align(16)) __m128; }

// Defines for Vector classes and similar structs (e.g. Matrix classes)
#define MK_MATH_VECTOR_CLASS(V) class __declspec(intrin_type) __declspec(align(16)) V##_MSTrick::__m128
#define MK_MATH_MATRIX_CLASS(M) class __declspec(align(16)) M
#define MK_MATH_VECTOR1_CTOR    __m128
#define MK_MATH_VECTOR3_CTOR    __m128
#define MK_MATH_VECTOR4_CTOR    __m128

// Forward declarations and typedefs for using 16 byte aligned structs from Math library.
typedef mk::Core::Math::Vector1_MSTrick::__m128      Vector1;
typedef mk::Core::Math::Vector3_MSTrick::__m128      Vector3;
typedef mk::Core::Math::Vector4_MSTrick::__m128      Vector4;
typedef mk::Core::Math::Quaternion_MSTrick::__m128   Quaternion;
class                                                Matrix3x3;
class                                                Matrix4x4;

// typedefs for parameter passing.
typedef Vector1    const  Vector1ConstValue;
typedef Vector1    const& Vector1ConstRef;
typedef Vector3    const  Vector3ConstValue;
typedef Vector3    const& Vector3ConstRef;
typedef Vector4    const  Vector4ConstValue;
typedef Vector4    const& Vector4ConstRef;
typedef Quaternion const  QuaternionConstValue;
typedef Quaternion const& QuaternionConstRef;
typedef Matrix3x3  const& Matrix3x3ConstRef;
typedef Matrix4x4  const& Matrix4x4ConstRef;

} // namespace Math
} // namespace Core
} // namespace mk